<html>
<head><meta charset="utf-8"><title>rustc_trait_selection ignoring const trait predicate? · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html">rustc_trait_selection ignoring const trait predicate?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246584644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246584644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246584644">(Jul 20 2021 at 13:36)</a>:</h4>
<p>Can someone tell me why on this line: <a href="https://github.com/rust-lang/rust/blob/718d53b0cb7dde93499cb92950d60b412f5a3d05/compiler/rustc_trait_selection/src/traits/fulfill.rs#L355">https://github.com/rust-lang/rust/blob/718d53b0cb7dde93499cb92950d60b412f5a3d05/compiler/rustc_trait_selection/src/traits/fulfill.rs#L355</a> the constness of the predicate is ignored? Why does this work for generic bounds on const fns?</p>
<p>Background: I am trying to come up with a fix for assoc types in const impls not bounded as const.</p>



<a name="246685769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246685769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246685769">(Jul 21 2021 at 07:00)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> in <a href="https://github.com/rust-lang/rust/pull/79287/files">https://github.com/rust-lang/rust/pull/79287/files</a> you said:</p>
<blockquote>
<p>We should have a proper check, and I think the only way to do that is to do it via well-formedness checks, though I'm not sure if we need a new one. Basically we need to add that additional wf-check only from within const contexts.</p>
<p>The alternative (which you are suggesting I think?) is to encode in the existing wf-checks (that check whether a trait bound exists) that we are looking for a const Trait impl and not just a Trait impl when coming from a const context.</p>
</blockquote>
<p>Can you elaborate further on what should be done to fix this? (what should be changed in wf-check?)</p>



<a name="246832737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246832737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246832737">(Jul 22 2021 at 11:01)</a>:</h4>
<p>I don't remember. Looking into it I found out that <a href="https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs">https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs</a> is actually not testing th eright thing anymore</p>



<a name="246832822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246832822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246832822">(Jul 22 2021 at 11:02)</a>:</h4>
<p>As you can see <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7cccf58a7256b8d0df492eaeb191fb44">on the playground</a>, it needs a <code>#![feature(const_fn_trait_bound)]</code></p>



<a name="246832832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246832832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246832832">(Jul 22 2021 at 11:02)</a>:</h4>
<p>we should probably unignore that test so we have a canary</p>



<a name="246839018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246839018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246839018">(Jul 22 2021 at 12:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246832822">said</a>:</p>
<blockquote>
<p>As you can see <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7cccf58a7256b8d0df492eaeb191fb44">on the playground</a>, it needs a <code>#![feature(const_fn_trait_bound)]</code></p>
</blockquote>
<p>But the test is still not fixed, because we require a <code>const impl</code> but <code>S</code> is not.</p>



<a name="246840599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246840599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246840599">(Jul 22 2021 at 12:39)</a>:</h4>
<p>yea, it isn't fixed, but it also doesn't reproduce the problem as written</p>



<a name="246840616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246840616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246840616">(Jul 22 2021 at 12:39)</a>:</h4>
<p>I got distracted mid-searching for more info XD</p>



<a name="246840787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246840787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246840787">(Jul 22 2021 at 12:41)</a>:</h4>
<p>I guess we can't add requirements to const/static initializers after the fact. If we required all trait usage to be const impls, we'd break things like <code>const FOO: () { &lt;Type as Trait&gt;::SOME_CONST; }</code></p>



<a name="246840797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246840797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246840797">(Jul 22 2021 at 12:41)</a>:</h4>
<p>where <code>impl Trait for Type</code> without <code>const</code></p>



<a name="246840803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246840803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246840803">(Jul 22 2021 at 12:41)</a>:</h4>
<p>so I guess we do need to just look at function calls</p>



<a name="246840882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246840882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246840882">(Jul 22 2021 at 12:42)</a>:</h4>
<p>We can either implement it in const checking or in wf-checking</p>



<a name="246851092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246851092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246851092">(Jul 22 2021 at 14:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246840803">said</a>:</p>
<blockquote>
<p>so I guess we do need to just look at function calls</p>
</blockquote>
<p>I'm confused. The real problem is that <code>PredicateKind::Trait(_, Constness::Const)</code> is ignored. The only thing that we changed in the trait selection AFAIK, was to drop non-const <code>impl</code>s in favor of const <code>impl</code>s. So in the case that a non-const <code>impl</code> is selected (no const <code>impl</code> found), we don't error, <strong>until</strong> we use it (call some function on the type)</p>



<a name="246851710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246851710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246851710">(Jul 22 2021 at 14:08)</a>:</h4>
<p>oh</p>



<a name="246851783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246851783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246851783">(Jul 22 2021 at 14:09)</a>:</h4>
<p>I'm worried that not ignoring it will break existing code, but maybe we don't actually use such predicates there</p>



<a name="246851825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246851825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246851825">(Jul 22 2021 at 14:09)</a>:</h4>
<p>it is definitely worth a try. It was probably an oversight or a "don't touch too much" when that code was added</p>



<a name="246851975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246851975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246851975">(Jul 22 2021 at 14:10)</a>:</h4>
<p>also i think it was weird to have constness inside the variant instead of <code>TraitPredicate</code> i will open a pr for that in a sec</p>



<a name="246852105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246852105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246852105">(Jul 22 2021 at 14:11)</a>:</h4>
<p>please sync with <span class="user-mention" data-user-id="220273">@Jane Lusby</span> on that, she is also modifying <code>TraitPredicate</code> to contain a negation flag</p>



<a name="246855891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246855891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246855891">(Jul 22 2021 at 14:38)</a>:</h4>
<p>looks like <code>filter_negative_and_reservation_impls</code> is also the function that I want to modify. I will filter out non-const candidates when the obligation is <code>const</code>.</p>



<a name="246863893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246863893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246863893">(Jul 22 2021 at 15:35)</a>:</h4>
<p>It actually caused breakage in libstd just as you thought, there are some const-unstable functions with bounds that will be unusable because my current change would always reject selected implementations if they are not const.</p>



<a name="246866675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246866675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246866675">(Jul 22 2021 at 15:55)</a>:</h4>
<p>The problem is, I don't know where the predicates/obligations come from. If I know that a predicate from a function call originates from a non-const context I can then transform the predicates to be non-const, i guess</p>



<a name="246867022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246867022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246867022">(Jul 22 2021 at 15:58)</a>:</h4>
<p>or I can remove all the const bounds from generics of const fn</p>



<a name="246867093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246867093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246867093">(Jul 22 2021 at 15:59)</a>:</h4>
<p>and attempt to prove them in check_consts?</p>



<a name="246869439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246869439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246869439">(Jul 22 2021 at 16:17)</a>:</h4>
<p>I would prefer to keep them around, and instead ignore them outside of const contexts. Not sure if that is possible?</p>



<a name="246870510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246870510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246870510">(Jul 22 2021 at 16:25)</a>:</h4>
<p>me neither. the solution might be keeping the non-const impl and decide whether that is desirable up the call stack, or we don't, but instead pass down non-const predicate at one point when we know that we are in a non-const context. I have no idea where I should change for either of these solutions</p>



<a name="246875329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246875329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246875329">(Jul 22 2021 at 17:00)</a>:</h4>
<p>how about:</p>
<ul>
<li>First we remove const bounds added in astconv when the item is <code>const fn</code>:</li>
</ul>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">constness</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">default_constness_for_trait_bounds</span><span class="p">();</span><span class="w"></span>
</code></pre></div>
<ul>
<li>Then we make it so that <code>TraitPredicate</code> would only be const when we expect it to be</li>
<li>This means assoc types on const impls will transform their predicates when typechecking</li>
</ul>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="c1">// if the item is inside a const impl, we transform the predicates to be const.</span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">pred_map</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">match</span><span class="w"> </span><span class="n">tcx</span><span class="p">.</span><span class="n">impl_constness</span><span class="p">(</span><span class="n">impl_ty</span><span class="p">.</span><span class="n">container</span><span class="p">.</span><span class="n">assert_impl</span><span class="p">())</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">hir</span>::<span class="n">Constness</span>::<span class="n">NotConst</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="o">|</span><span class="n">p</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="o">|</span><span class="w"> </span><span class="n">p</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="n">hir</span>::<span class="n">Constness</span>::<span class="n">Const</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="o">|</span><span class="n">p</span>: <span class="nc">ty</span>::<span class="n">Predicate</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">tcx</span>: <span class="nc">TyCtxt</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;|</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">p</span><span class="p">.</span><span class="n">kind</span><span class="p">()</span><span class="w"></span>
<span class="w">                    </span><span class="p">.</span><span class="n">map_bound</span><span class="p">(</span><span class="o">|</span><span class="n">kind</span><span class="o">|</span><span class="w"> </span><span class="k">match</span><span class="w"> </span><span class="n">kind</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                        </span><span class="n">ty</span>::<span class="n">PredicateKind</span>::<span class="n">Trait</span><span class="p">(</span><span class="k">mut</span><span class="w"> </span><span class="n">tp</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                            </span><span class="n">tp</span><span class="p">.</span><span class="n">constness</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">hir</span>::<span class="n">Constness</span>::<span class="n">Const</span><span class="p">;</span><span class="w"></span>
<span class="w">                            </span><span class="n">ty</span>::<span class="n">PredicateKind</span>::<span class="n">Trait</span><span class="p">(</span><span class="n">tp</span><span class="p">)</span><span class="w"></span>
<span class="w">                        </span><span class="p">}</span><span class="w"></span>
<span class="w">                        </span><span class="n">kind</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">kind</span><span class="p">,</span><span class="w"></span>
<span class="w">                    </span><span class="p">})</span><span class="w"></span>
<span class="w">                    </span><span class="p">.</span><span class="n">to_predicate</span><span class="p">(</span><span class="n">tcx</span><span class="p">)</span><span class="w"></span>
<span class="w">            </span><span class="p">},</span><span class="w"></span>
<span class="w">        </span><span class="p">};</span><span class="w"></span>
</code></pre></div>
<ul>
<li>When we know that we are in a const context we transform the predicates of callee and check if those are met (maybe in check_consts)</li>
<li>This will work (solves both issues: assoc types not bounded &amp; not rejecting calling const fn with non-const impl as param) but might be bad for performance because we are not doing the predicates check in typeck</li>
</ul>



<a name="246961519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246961519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246961519">(Jul 23 2021 at 10:25)</a>:</h4>
<p>I don't think that will work. We need to be able to track the const/nonconst from the ast in order to know the difference between <code>?const Trait</code> and <code>Trait</code> bounds on <code>const fn</code>.</p>



<a name="246961807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246961807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246961807">(Jul 23 2021 at 10:28)</a>:</h4>
<p>So... maybe we have been doing this all wrongly</p>



<a name="246961818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246961818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246961818">(Jul 23 2021 at 10:28)</a>:</h4>
<p>like, not what you are doing, but how the thing is done to begin with</p>



<a name="246962128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246962128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246962128">(Jul 23 2021 at 10:32)</a>:</h4>
<p>In my RFC I talked about a hypothetical effect-system that represents what we want. I don't want an effect system, but we could do something almost like that. Basically we add a new kind of generic parameter that doesn't exist syntactically, but we fill it in correctly. So <code>const fn foo&lt;T: Trait&gt;()</code> becomes <code>fn foo&lt;constness C, T: Trait&lt;C&gt;&gt;()</code>. Then we fill in these constness parameters similarly to how we substitute generic parameters with concrete ones</p>



<a name="246965425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246965425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246965425">(Jul 23 2021 at 11:20)</a>:</h4>
<p>...and that can just be syntactic sugar for something like this, with "const" generics?</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// trait Tr {}</span>
<span class="k">trait</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">CONSTNESS</span>: <span class="kt">bool</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// impl const Tr for u8 {}</span>
<span class="k">impl</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">C</span>: <span class="kt">bool</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="n">C</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// impl Tr for i8</span>
<span class="k">impl</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="kc">false</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">i8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// const fn const_fn&lt;NonConst: ?const Tr, Const: Tr&gt;() {}</span>
<span class="k">fn</span> <span class="nf">const_fn</span><span class="o">&lt;</span><span class="n">NonConst</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="kc">false</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">Const</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="kc">true</span><span class="o">&gt;&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="246965946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246965946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246965946">(Jul 23 2021 at 11:27)</a>:</h4>
<p>then we will need to add a generic arg to every trait, which might have implications..</p>



<a name="246966018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246966018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246966018">(Jul 23 2021 at 11:28)</a>:</h4>
<p>it might also affect performance since we complicate the trait selection process for every trait</p>



<a name="246967832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246967832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246967832">(Jul 23 2021 at 11:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="361356">fee1-dead</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246965425">said</a>:</p>
<blockquote>
<p>...and that can just be syntactic sugar for something like this, with "const" generics?</p>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// trait Tr {}</span>
<span class="k">trait</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">CONSTNESS</span>: <span class="kt">bool</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// impl const Tr for u8 {}</span>
<span class="k">impl</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">C</span>: <span class="kt">bool</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="n">C</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// impl Tr for i8</span>
<span class="k">impl</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="kc">false</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">i8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// const fn const_fn&lt;NonConst: ?const Tr, Const: Tr&gt;() {}</span>
<span class="k">fn</span> <span class="nf">const_fn</span><span class="o">&lt;</span><span class="n">NonConst</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="kc">false</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">Const</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="kc">true</span><span class="o">&gt;&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>
<p>Don't say out the quiet part loud <span aria-label="stuck out tongue" class="emoji emoji-1f61b" role="img" title="stuck out tongue">:stuck_out_tongue:</span> yes, we could totally just encode this as magic const generic parameters</p>



<a name="246967898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246967898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246967898">(Jul 23 2021 at 11:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="361356">fee1-dead</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246966018">said</a>:</p>
<blockquote>
<p>it might also affect performance since we complicate the trait selection process for every trait</p>
</blockquote>
<p>yea, but, don't we already do this with the new field on <code>TraitPredicate</code>?</p>



<a name="246967912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246967912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246967912">(Jul 23 2021 at 11:54)</a>:</h4>
<p>We can almost keep the current system</p>



<a name="246967967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246967967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246967967">(Jul 23 2021 at 11:56)</a>:</h4>
<p>I guess we just need a third variant <code>ConstnessVar</code> that we ICE if encountered during actual trait comparisons, and thus require them to have already been substituted with a concrete one</p>



<a name="246968011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246968011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246968011">(Jul 23 2021 at 11:56)</a>:</h4>
<p>we only generate them for const impls and const fn</p>



<a name="246987012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246987012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246987012">(Jul 23 2021 at 14:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246967898">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="361356">fee1-dead</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246966018">said</a>:</p>
<blockquote>
<p>it might also affect performance since we complicate the trait selection process for every trait</p>
</blockquote>
<p>yea, but, don't we already do this with the new field on <code>TraitPredicate</code>?</p>
</blockquote>
<p>no because it (interacting with the new field) only happens when we have one candidate left. I think I might be wrong because I am not familiar with the system...</p>



<a name="246987334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246987334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246987334">(Jul 23 2021 at 14:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F/near/246967967">said</a>:</p>
<blockquote>
<p>I guess we just need a third variant <code>ConstnessVar</code> that we ICE if encountered during actual trait comparisons, and thus require them to have already been substituted with a concrete one</p>
</blockquote>
<p>Third variant of which enum?</p>



<a name="246988328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246988328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246988328">(Jul 23 2021 at 15:00)</a>:</h4>
<p>The <code>Constness</code> enum could get an <code>Infer</code> variant, that explicitly differentiates from known <code>NotConst</code> or <code>Const</code>, meaning we will have to treat it as <code>Const</code> if we are in a const context and as <code>NotConst</code> otherwise. This will push the work all the way down to where the comparison is necessary, but it also means we need to carry the const-contextness along throughout trait resolution</p>



<a name="246988799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246988799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246988799">(Jul 23 2021 at 15:02)</a>:</h4>
<p>alternatively we can eagerly substitute it with the appropriate variant before feeding it to trait resolution, but as you said, that may be expensive</p>



<a name="246996968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246996968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246996968">(Jul 23 2021 at 16:04)</a>:</h4>
<p>I can't find where I can insert the const-context <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="246998182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246998182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246998182">(Jul 23 2021 at 16:15)</a>:</h4>
<p>Is there some context object available? Something where we usually get the TyCtxt from? Maybe you can add a new field somewhere</p>



<a name="246998365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/246998365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#246998365">(Jul 23 2021 at 16:16)</a>:</h4>
<p>I am going into the weekend soonish, so I can't dig into it right now, maybe start out with an eager approach that substitutes early just to see if this works in general?</p>



<a name="247001947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/247001947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#247001947">(Jul 23 2021 at 16:45)</a>:</h4>
<p>I believe it is <code>FnCtxt</code>, I will try that tomorrow.</p>



<a name="247082377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection%20ignoring%20const%20trait%20predicate%3F/near/247082377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> fee1-dead <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rustc_trait_selection.20ignoring.20const.20trait.20predicate.3F.html#247082377">(Jul 24 2021 at 16:15)</a>:</h4>
<p>edit: deleted</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>